<?php

/**
 * @file
 * Default simple view template to display a list of rows.
 *
 * @ingroup views_templates
 */
$anni = array();
$lang = '';
if(count(locale_language_list('name')) > 1){
	global $language;
	$lang = $language->language.'/';
}
?>
<?php foreach ($rows as $id => $row): ?>
    <?php 
    	$anno = date('Y', strtotime(strip_tags($row)));
    	$anni[$anno] = $anno;
    ?>
<?php endforeach; ?>


<?php foreach ($anni as $k => $anno): ?>

<?php 
	$href_anno = base_path().$lang.'news?anno=' . $anno;
	if(isset($_GET['anno']) && $_GET['anno'] == $anno){
		$href_anno = 'javascript:void(0);';
	}
?>

	<div class="anno">
		<a href="<?php print $href_anno;?>" class="selezione_anno closed" id="selezione_<?php print $anno;?>"><?php print $anno;?></a>
		<div class="mesi" id="anno_<?php print $anno;?>" style="display:none;">
			<div class="mese"><a id="mese_01" href="<?php print base_path().$lang;?>news?mese=01&anno=<?php print $anno;?>">01</a></div>
			<div class="mese"><a id="mese_02" href="<?php print base_path().$lang;?>news?mese=02&anno=<?php print $anno;?>">02</a></div>
			<div class="mese"><a id="mese_03" href="<?php print base_path().$lang;?>news?mese=03&anno=<?php print $anno;?>">03</a></div>
			<div class="mese"><a id="mese_04" href="<?php print base_path().$lang;?>news?mese=04&anno=<?php print $anno;?>">04</a></div>
			<div class="mese"><a id="mese_05" href="<?php print base_path().$lang;?>news?mese=05&anno=<?php print $anno;?>">05</a></div>
			<div class="mese last"><a id="mese_06" href="<?php print base_path().$lang;?>news?mese=06&anno=<?php print $anno;?>">06</a></div>
			<div class="mese"><a id="mese_07" href="<?php print base_path().$lang;?>news?mese=07&anno=<?php print $anno;?>">07</a></div>
			<div class="mese"><a id="mese_08" href="<?php print base_path().$lang;?>news?mese=08&anno=<?php print $anno;?>">08</a></div>
			<div class="mese"><a id="mese_09" href="<?php print base_path().$lang;?>news?mese=09&anno=<?php print $anno;?>">09</a></div>
			<div class="mese"><a id="mese_10" href="<?php print base_path().$lang;?>news?mese=10&anno=<?php print $anno;?>">10</a></div>
			<div class="mese"><a id="mese_11" href="<?php print base_path().$lang;?>news?mese=11&anno=<?php print $anno;?>">11</a></div>
			<div class="mese last"><a id="mese_12" href="<?php print base_path().$lang;?>news?mese=12&anno=<?php print $anno;?>">12</a></div>
		</div>
	</div>
	<div class="clear"></div>
<?php endforeach;?>